cmake_minimum_required(VERSION 3.6.0)
if (NOT ROOT_DIR)
    set(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../")
endif()
set(CURRENT_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/toolchain_common.cmake)

include(${CURRENT_CMAKE_PATH})
# set the other flags
set(CMAKE_C_STANDARD_LIBRARIES_INIT "-lm")
set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "-lm")
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

add_definitions(-DUSE_HTNICE)

if (NOT COMPILER_ROOT)
    set(COMPILER_ROOT ${ROOT_DIR}/buildtools/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux)
endif()

set(CMAKE_SYSROOT ${COMPILER_ROOT}/aarch64-htnice-linux-gnu)
set(CMAKE_C_COMPILER "${COMPILER_ROOT}/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "${COMPILER_ROOT}/bin/arm-linux-gnueabihf-g++")
message(INFO " C compiler is ${CMAKE_C_COMPILER}")
message(INFO " CXX compiler is ${CMAKE_CXX_COMPILER}")
